package com.lyf.baoxian.utils;

import android.content.Context;

/**
 * Created by 刘亚飞 on 2016/11/30.
 */

public class Dp2pxUtil {
    public static int dp2px(int dp, Context context) {
        //获取手机屏幕密度
        float density = context.getResources().getDisplayMetrics().density;
        return (int) (dp * density + 0.5f);
    }
}
